#coding=utf-8
"""
===========================
Author:李灵娜
Time:2023/3/24 18:26
website:https://duoceshi.net
===========================
"""
import sys
sys.path.append('..')

from config.config import *
import time
import unittest
from public.utiles.HTMLTestRunnerNew import HTMLTestRunner
now = time.strftime('%Y-%m-%d-%H-%M-%S')
filename = report_path+'\\'+str(now)+"_ui_report.html"
# print(filename)
def auto_run():
    discover = unittest.defaultTestLoader.discover(start_dir=testcase_path,
                                                   pattern='test_*.py')
    f = open(filename,'wb')
    runner = HTMLTestRunner(stream=f,
                            title="cms后台系统ui自动化测试报告",
                            description='用例执行情况如下',
                            tester="小李")
    runner.run(discover)
    f.close()
if __name__ == '__main__':
    auto_run()

